/*
 * Name: Contact
 * Author: Sam Oakley
 * Date: 20/3/2010
 * Version Number: 1.0
 * Description: Displays contact information. Has button to open email client. 
 * Changes History: 
 * 1.0 Created class
 */

package com.blork.rag;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class Contact extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.contact);
       
        final Button button = (Button) findViewById(R.id.email_button);
        button.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
            	emailClick();
            }
        });        
              
    }
    
	/*
	 * Name: emailClick
	 * Description: Starts a new activity to send an email
	 */   
	public void emailClick() {
		Intent emailIntent = new Intent(Intent.ACTION_SEND); 
		emailIntent.setType("message/rfc822");
		emailIntent.putExtra(Intent.EXTRA_EMAIL, new String[]{this.getResources().getString(R.string.contact_email)}); 
		emailIntent.putExtra(Intent.EXTRA_SUBJECT, "Question sent from Android Application"); 
		this.startActivity(emailIntent);
	}
		
}
